package com.ml.mall.model.mail.partner;

import com.ml.mall.model.MailMessage;
import org.springframework.stereotype.Component;

/**
 * @description 该工具类为合作商添加邮件发送模板
 * @author pl
 * @date 2021/7/13
 * @version 1.0
*/
@Component
public class MailTempleteForPartner {


    /**
     * 合伙人邀请链接，系统发送 “合伙人邀请链接” 给合作商
     * @param to 收件人邮箱
     * @return
     */
    public MailMessage getPartnerInvitationLink(String to){

        MailMessage mailMessage = new MailMessage();
        //设置模板标题
        mailMessage.setSubject("Invitation to become Airena Procure partner");
        mailMessage.setReceiverEmail(to);
        mailMessage.setContent(
                "<div style=\"width: 1000px; margin: auto; text-align: left;font-family: 'Helvetica', sans-serif;\">\n" +
                "       <img src=mainPicUrl style=\"width: 100%; height: 200px; margin: -8px;\">\n" +
                "       <div style=\"border-bottom: solid 0.5px #e1e6ed; padding-bottom: 50px; width: 90%; margin: auto;\">\n" +
                "           <div style=\"width: 70%;\">\n" +
                "           <span style=\"font-weight: bold; font-size: 32pt; color: #06375b;\">\n" +
                "                   We would like to invite you to join Airena Procure as <span style=\"color: #54af9a;\">Partner</span>!\n" +
                "               </span>\n" +
                "           </div>\n" +
                "       </div>\n" +
                "       <div style=\"width: 90%; margin: auto; padding-top: 20px;\">\n" +
                "           <p>Hi, <strong></strong></p>\n" +
                "           <br>\n" +
                "           <p>You are invited to register as a partner in Airena Procure!</p>\n" +
                "           <a href=system_registration_url style=\"background-color: #2C84EA; color: white; padding: 14px 25px; text-align: center; text-decoration: none; display: inline-block; border-radius: 12px;\">Register</a>\n" +
                "           <br>\n" +
                "           <p>Need help? Contact <strong>contact_no</strong> or send email to <strong>general_email</strong> for enquiry.</p>\n" +
                "           <br>\n" +
                "           <p>Best regards,<br><strong>Airena Procure Team</strong></p>\n" +
                "           \n" +
                "       </div>\n" +
                "   </div>");

        return mailMessage;
    }

    /**
     * 邀请的卖家账号被批准，系统发送 “邀请的卖家账号被批准” 邮件给合作商
     * @param to 收件人邮箱
     * @return
     */
    public MailMessage getInvitedSupplierApproved(String to){

        MailMessage mailMessage = new MailMessage();
        //设置模板标题
        mailMessage.setSubject("Supplier company_name has successfully onboard.");
        mailMessage.setReceiverEmail(to);
        mailMessage.setContent(
                "<div style=\"width: 1000px; margin: auto; text-align: left;font-family: 'Helvetica', sans-serif;\">\n" +
                "   <img src=mainPicUrl style=\"width: 100%; height: 200px; margin: -8px;\">\n" +
                "   <div style=\"border-bottom: solid 0.5px #e1e6ed; padding-bottom: 50px; width: 90%; margin: auto;\">\n" +
                "        <div style=\"width: 70%;\">\n" +
                "        <span style=\"font-weight: bold; font-size: 32pt; color: #06375b;\">\n" +
                "            Invited supplier <span style=\"color: #54af9a;\">company_name</span> has onboarded!\n" +
                "        </span>\n" +
                "        </div>\n" +
                "    </div>\n" +
                "    <div style=\"width: 90%; margin: auto; padding-top: 20px;\">\n" +
                "        <p>Hi <strong>partner_name</strong></p>\n" +
                "        <br>\n" +
                "        <p>The invited supplier <strong>company_name</strong> has been approved by admin.</p>\n" +
                "        <br>\n" +
                "        <p>Best regards,<br><strong>Airena Procure Team</strong></p>\n" +
                "        \n" +
                "    </div>\n" +
                "</div>");

        return mailMessage;
    }
}
